package com.medeolinx.model;

import com.medeolinx.model.data.Terrain;
import com.medeolinx.model.data.User;

/**
 * facade class to manage data
 * 
 * @author Chen Qingqing
 */
public interface ModelManager {
	boolean validateUser(String name, String pwd);

	/**
	 * @return 1 for success. if fail return -1.
	 */
	int addNewUser(User user) throws Throwable;

	User getUser(String name, String pwd);

	/**
	 * 
	 * @param user can be detached object
	 * @param name album name
	 */
	User addAlbum(User user, String name) throws Throwable;

	User delAlbum(User user, int id) throws Throwable;

	int addTerrain(int album_id, Terrain t) throws Throwable;

	User delTerrain(User user, int terrain_id) throws Throwable;

	Terrain getTerrain(int id) throws Throwable;

	boolean addComment(String username, int terrain_id, String comment) throws Throwable;
}
